package com.hanamaki.dataStructDemo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;

public class ArrayListGeneral {

    public static void main(String[] args) {

        List<String> s = new ArrayList<>();
        s.add("test");
        List<Integer> i = new ArrayList<>();
        i.add(34);

        printList(s);
        printList(i);

        System.out.println(maxMin(1, 2, 3));
        System.out.println(maxMin("c", "34", "a"));

    }


    // 打印集合
    public static void printList(List<?> list) {
        System.out.println(list.get(0));

    }

    public static  <T extends Comparable> T maxMin(T x, T y, T z) {
        T max = x;
        if (y.compareTo(max) > 0) {
            max = y;
        }
        if (z.compareTo(max) > 0) {
            max = z;
        }
        return max;
    }

}
